{% extends 'EasyVoteBundle::layout.html.twig' %}

{% block title %}EasyVote | My Profile{% endblock %}

{% block content %}
{% if isProfileComplete == false %}
	<p class="text-center" style="background: #ff544a;color: #000;padding: 5px;"><span style="color: #FFF;"><strong>Alert:</strong></span>&nbsp;<a href="{{ path('profile_edit', {'id': user.id}) }}" style="color: #000;"><u>Please update your profile</u></a>.</p>
{% endif %}
<div class="container" style="padding-top: 20px;">
    <div class="row row-centered">
        <div class="col-md-3 col-centered">
            <div class="panel panel-default">
                <div class="panel-heading panel-title">{{ user.displayName }}</div>
                <div class="panel-body">
                    {# Retrieve the profile picture from database #}
                    <img src="{{ user.profile ? user.profile.picture }}" width="200px" height="200px" class="img-responsive img-thumbnail center-block">
                </div>
                <ul class="list-group">
                    <li class="list-group-item"><strong>EUID:</strong> {{ user.euid }}</li>
                    <li class="list-group-item"><strong>ID Number:</strong> {{ user.employeeNumber }}</li>
                    <li class="list-group-item"><strong>Principal Name:</strong> {{ user.principalName }}</li>
                    <li class="list-group-item"><strong>Email:</strong>
                        {% for email in user.emails %}
                            {{ email.value }}{% if email != loop.last %},{% endif %}
                        {% endfor %}
                    </li>
                    <li class="list-group-item"><strong>Affiliations:</strong>
                        {% for affiliation in user.affiliations %}
                        {{ affiliation.name|capitalize }}{% if affiliation != loop.last %},{% endif %}
                        {% endfor %}
                    </li>
                    <li class="list-group-item"><strong>Scoped Affiliations:</strong>
                        {% for affiliation in user.scopedAffiliations %}
                            {{ affiliation.value }}{% if affiliation != loop.last %},{% endif %}
                        {% endfor %}
                    </li>
                    <li class="list-group-item"><strong>Degree:</strong>
						{% for degree in user.degrees %}
							{{ degree.displayName }}{% if degree != loop.last %},{% endif %}
						{% endfor %}
                    </li>
                    <li class="list-group-item"><strong>Classification:</strong>
						{% if user.classification %}
							{{ user.classification.name }}
						{% endif %}
                    </li>
                    {# <li class="list-group-item"><strong>Major:</strong> Not available<span class="pull-right"><a href="{{ path('profile_edit') }}">Edit</a></span></li> #}
                    {# <li class="list-group-item"><strong>Minor:</strong> Not available<span class="pull-right"><a href="{{ path('profile_edit') }}">Edit</a></span></li> #}
                </ul>
            </div>
        </div>

        <!-- About Me Column -->
        <div class="col-md-8 col-centered">
            <div class="panel panel-default">
                <div class="panel-heading">About
                <span class="pull-right">
					{% if isCurrentUser or isAdmin %}
						<a href="{{ path('profile_edit', {'id': user.id}) }}" class="text-primary" style="text-decoration: none; color: #fff;">Edit</a>
					{% endif %}
                </span>
                </div>
                <div class="panel-body">
                    {# Retrieve profile about text from database #}
                    {{ user.profile.summary }}
                </div>
            </div>
        </div>
    </div>
</div>
    <!-- Fixed Bottom Navbar -->
    <nav class="navbar navbar-default navbar-fixed-bottom" role="navigation">
        <div class="container">
            <div class="nav navbar-right pull-right">
                {% if isCurrentUser or isAdmin %}
					<a href="{{ path('profile_edit', {'id': user.id}) }}"><button class="btn navbar-btn btn-success">Edit Profile</button></a>
				{% endif %}
                <button class="btn navbar-btn btn-danger" onclick="window.history.back()">Back</button>
            </div>
        </div>
    </nav>
{% endblock %}
